package com.cwl.base.day03.oop;

/**
 * @program: java_base
 * @description:
 * @author: ChenWenLong
 * @create: 2019-11-07 10:43
 **/
public class TestObject {

    public static void main(String[] args) {
//		Object obj;

        TestObject   to = new TestObject();
        System.out.println(to.toString());

        Person2  p2 = new Person2("String", 6);
        System.out.println(p2.toString());

    }

    public String toString(){
        return  "String";
    }
}

class Person2 {
    String name;
    int age;

    @Override
    public String toString() {
        return name+",String"+age;
    }

    public Person2(String  name, int age) {
        this.name = name;
        this.age = age;
    }


}